Skip to content

Feat/xread maxcount maxsize#3335

Open
nkaradzhov wants to merge 2 commits into
redis:masterfrom
nkaradzhov:feat/xread-maxcount-maxsize
Open

Feat/xread maxcount maxsize#3335
nkaradzhov wants to merge 2 commits into
redis:masterfrom
nkaradzhov:feat/xread-maxcount-maxsize

Conversation

@nkaradzhov

@nkaradzhov nkaradzhov commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Redis 8.10 adds cumulative reply caps across all streams in XREAD and
XREADGROUP. Unlike COUNT (per-stream), MAXCOUNT caps the total number of
entries and MAXSIZE soft-caps the total reply size in bytes across all
stream keys.

Both are exposed as optional numeric fields on the existing options
objects and emitted as uppercase tokens in canonical order before
STREAMS, omitted when unset. Purely additive: response shape, blocking,
consumer-group, and stream-id semantics are unchanged and the existing
Streams reply parser is reused. No client-side validation is added, so
server errors propagate as-is. Options are since 8.10.0.

The XREADGROUP option push order was aligned to the canonical order
(COUNT MAXCOUNT MAXSIZE BLOCK CLAIM NOACK).

Fix XREAD to guard COUNT with \!== undefined instead of a truthy check,
so COUNT: 0 is forwarded consistently with MAXCOUNT/MAXSIZE/BLOCK and
with XREADGROUP.

nkaradzhov and others added 2 commits July 13, 2026 12:46
Redis 8.10 adds cumulative reply caps across all streams in XREAD and
XREADGROUP. Unlike COUNT (per-stream), MAXCOUNT caps the total number of
entries and MAXSIZE soft-caps the total reply size in bytes across all
stream keys.

Both are exposed as optional numeric fields on the existing options
objects and emitted as uppercase tokens in canonical order before
STREAMS, omitted when unset. Purely additive: response shape, blocking,
consumer-group, and stream-id semantics are unchanged and the existing
Streams reply parser is reused. No client-side validation is added, so
server errors propagate as-is. Options are since 8.10.0.

The XREADGROUP option push order was aligned to the canonical order
(COUNT MAXCOUNT MAXSIZE BLOCK CLAIM NOACK).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add cumulative MAXSIZE cap integration tests for XREAD and XREADGROUP
(MAXSIZE 1 over two streams returns exactly one entry, matching the
server's global soft-cap semantics), gated to Redis 8.10+.

Fix XREAD to guard COUNT with `\!== undefined` instead of a truthy check,
so `COUNT: 0` is forwarded consistently with MAXCOUNT/MAXSIZE/BLOCK and
with XREADGROUP.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nkaradzhov nkaradzhov requested a review from PavelPashov July 13, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants